package com.projectfile.service;

import com.projectfile.dao.UserMapper;
import com.projectfile.entity.Money;
import com.projectfile.entity.User;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserSrvImpl {
    @Resource
    private UserMapper mapper;

    public int addUser(User user){
        return mapper.adduser(user);
    }
    public int save(User user){
        return mapper.save(user);
    }
    public int withdraw(User user){
        return mapper.withdraw(user);
    }
    public int addsave(Money money){
        return mapper.addsave(money);
    }
    public User balance(int userid){
        return mapper.balance(userid);
    }
//    public PageInfo<Money> history(String userid,int pageNum,int pageSize){
//        Page page = PageHelper.startPage(pageNum,pageSize,true);
//        List list =mapper.history(userid);
//        PageInfo<Money> pageInfo=new PageInfo<Money>(list,page.getPages());
//        return pageInfo;
//    }
    public List<Money> history(String userid){
        return mapper.history(userid);
    }


}
